package DAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class FabricaConexao {

    public static Connection getConnection() throws ErroConexao {

        Connection conn;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            conn = DriverManager.getConnection("jdbc:mysql://localhost/biblionline", "root", "");
        } catch (ClassNotFoundException e) {
            throw new ErroConexao(e);
        } catch (SQLException e) {
            throw new ErroConexao(e);
        }
        return conn;
    }
}
